package com.zhiche.lisa.lspm.service.fleet;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.zhiche.lisa.lspm.dao.model.carrier.CarrierInfo;
import com.zhiche.lisa.lspm.dao.model.driver.Driver;
import com.zhiche.lisa.lspm.dao.model.fleet.FleetBind;
import com.zhiche.lisa.lspm.dao.model.trailer.TrailerInfo;
import com.zhiche.lisa.lspm.dto.PersonFleetBindDTO;
import com.zhiche.lisa.lspm.vo.fleet.FleetBindVO;
import com.zhiche.lisa.lspm.vo.vehicle.CarrierBasicVO;
import com.zhiche.lisa.lspm.vo.vehicle.TrailerBasicVO;

import java.util.List;

/**
 * <p>
 * 车队与资源绑定关系 服务类
 * </p>
 *
 * @author qichao
 * @since 2018-07-18
 */
public interface IFleetBindService extends IService<FleetBind> {
    /**
     * 根据车队信息获取所属承运商下的未绑定车辆
     */
    List<FleetBindVO> queryFleetUnBindLine(FleetBindVO fleetBindVO, String authorization);

    /**
     * 根据车队信息获取所属承运商下的已绑定车辆
     */
    Page<FleetBindVO> queryFleetBindLine(Page<FleetBindVO> page, String authorization);

    /**
     * 移入车队
     */
    void insertFleetBind(Long fleetId, Long resourceId, String authorization);

    /**
     * 删除司机/牵引车/司机和车队的关联
     */
    void deleteFleetBind(Long id, String resourceType);


    /**
     * 获取车队绑定司机信息集合
     */
    Page<Driver> queryDriverBindWithFleet(Page<Driver> fleetBindsVOPage);

    /**
     * 获取车队绑定信息集合
     */
    Page<CarrierBasicVO> queryBindCarrierList(Page<CarrierInfo> fleetBindsVOPage);

    /**
     * 获取车队绑定信息集合
     */
    Page<TrailerBasicVO> queryBindTrailerWithFleetId(Page<TrailerInfo> fleetBindsVOPage);


    /**
     * 匹配对应车队的车辆信息
     *
     * @param ew 条件对象
     */
    List<FleetBindVO> queryBindCarrierList(EntityWrapper<FleetBindVO> ew);

    /**
     * 增加人送司机绑定车队
     */
    void insertPersonBind(PersonFleetBindDTO dto, String authorization);

    /**
     * 根据车队信息获取所属承运商下的未绑定人送司机
     */
    List<Driver> queryFleetUnBindDriver(FleetBindVO fleetBindVO, String authorization);

    /**
     * 根据车队信息获取所属承运商下的人送司机
     */
    Page<FleetBindVO> queryFleetBindDriver(Page<FleetBindVO> page, String authorization);

    /**
     * 人送司机加入车队
     */
    void insertDriverBindFleet(Long fleetId, Long resourceId, String authorization);

    List<FleetBindVO> queryFleetBindNoTenant(EntityWrapper<FleetBindVO> ew);

    /**
     * 司机更新推送erp
     */
    void driverToErp(Long carrierId, String authorization);

    List<FleetBind> selectListNoTenant(EntityWrapper<FleetBind> ew);

    void removePersonBind(PersonFleetBindDTO dto, String authorization);

    List<FleetBindVO> queryBindCarrierNoTenant(EntityWrapper<FleetBindVO> ew);

    List<FleetBindVO> queryBindDriverList(EntityWrapper<FleetBindVO> ew);

    List<FleetBindVO> queryBindTrailerList(EntityWrapper<FleetBindVO> ew);
}
